﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace ET.Score.Service 
{
    public class DriverTaskInfo : INotifyPropertyChanged
    {
        private string userid;
        private int trainId;
        private int simTrainId;
        private DateTime servertime;
        private DateTime startTime;
        private DateTime finishTime;
        private int tmnStationId;
        private int tmnStopPointId;
        private string stopAreaName;
        private string physAreaName;
        private int taskState;
        private List<int> score;
        private byte dir;
        public DriverTaskInfo()
        {
            score = new List<int>();
        }
        public string UserId
        {
            get { return userid; }
            set
            {
                userid = value;
                OnPropertyChanged();
            }
        } //测试员

        public int TrainId
        {
            get { return trainId; }
            set
            {
                trainId = value;
                OnPropertyChanged();
            }
        } //列车ID

        public int SimTrainId
        {
            get { return simTrainId; }
            set
            {
                simTrainId = value;
                OnPropertyChanged();
            }
        } //模拟器ID

        //推送时服务器时间，用来和服务器时间同步用的
        public DateTime ServerTime
        {
            get { return servertime; }
            set
            {
                servertime = value;
                OnPropertyChanged();
            }

        }
        public DateTime StartTime
        {
            get { return startTime; }
            set
            {
                startTime = value;
                OnPropertyChanged();
            }
        } //开始时间

        public DateTime FinishTime
        {
            get { return finishTime; }
            set
            {
                finishTime = value;
                OnPropertyChanged();
            }
        } //结束时间

        public int TmnStationId
        {
            get { return tmnStationId; }
            set
            {
                tmnStationId = value;
                OnPropertyChanged();
            }
        } //结束站点Id,其实是停车区域编号

        public int TmnStopPointId
        {
            get { return tmnStopPointId; }
            set
            {
                tmnStopPointId = value;
                OnPropertyChanged();
            }
        } //结束停车点编号

        public string StopAreaName
        {
            get { return stopAreaName; }
            set
            {
                stopAreaName = value;
                OnPropertyChanged();
            }
        } //停车区域名称

        public string PhysAreaName
        {
            get { return physAreaName; }
            set
            {
                physAreaName = value;
                OnPropertyChanged();
            }
        } //物理区段名称名称

        public int TaskState
        {
            get { return taskState; }
            set
            {
                taskState = value;
                OnPropertyChanged();
            }
        } //任务状态

        public List<int> Score
        {
            get { return score; }
            set
            {
                score = value;
                OnPropertyChanged();
            }
        } //分数

        public byte Dir
        {
            get { return dir; }
            set
            {
                dir = value;
                OnPropertyChanged();
            }
        } //方向
        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged([CallerMemberName] string propName = null)
        {
            var handle = PropertyChanged;
            if (handle != null)
                handle(this, new PropertyChangedEventArgs(propName));
        }
    }
}
